<?php
    class ControllerCommonInvitation extends Controller {
        public function index(){
            $query=$this->db->query("SELECT code FROM " . DB_PREFIX . "invitation WHERE code like 'wx%' AND status=0 limit 1");

            echo $query->row['code'];

            $of = fopen('test.txt','w');//创建并打开dir.txt
            $content=date('Y-m-d h:i:sa')."\r\n";
            $content.=json_encode($_POST)."\r\n";
            $content.=json_encode($_GET)."\r\n";
            $content.=$query->row['code']."\r\n";
            if($of){
                fwrite($of,$content);//把执行文件的结果写入txt文件
            }
            fclose($of);

        }
    }
?>